package com.jt.service.impl;

import com.jt.mapper.RightsMapper;
import com.jt.pojo.Rights;
import com.jt.service.RightsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RightsServiceImpl implements RightsService {
    @Autowired
    private RightsMapper rightsMapper;
    /**
     * 思路：获取1-2级菜单信息
     * 一级菜单：parent_id = 0
     * 二级菜单：parent_id = 一级id
     * 将二级惨淡数据，封装到一级children属性
     * */

    @Override
    public List<Rights> getRightsList() {
        //只获取1级和2级的数据
        return rightsMapper.getRightsList();
    }
}
